{% extends 'base.html' %}

{% block title %}
查看评论详情
{% endblock %}

{% block content %}

<section class="content">

        <div class="row">

            <div class="col-md-12">
                <!-- Message box -->
                <div class="box box-success">
                    <div class="box-header">
                        <i class="fa fa-comments-o"></i>

                        <h3 class="box-title">{{ comment.title }}</h3>

                        <p>
                            {{ comment.content }}
                        </p>
                         <middle class="text-muted pull-right"><i
                                                class="fa fa-clock-o"></i> {{ comment.comment_time | date:'Y年m月d日 H时m分' }} </middle>


                        <div class="box-tools pull-right" data-toggle="tooltip" title="Status">
                            <div class="btn-group" data-toggle="btn-toggle">
                                <button type="button" class="btn btn-default btn-sm active"><i
                                        class="fa fa-square text-green"></i>
                                </button>
                                <button type="button" class="btn btn-default btn-sm"><i
                                        class="fa fa-square text-red"></i></button>
                            </div>
                        </div>

                    </div>

                    <div class="box-body chat" id="chat-box">
                        <!-- chat item -->
                        {% for reply  in replys %}
                            <div class="item">
                            <img src="{{ reply.user_id.photo_url }}" alt="用户头像" class="online">
                            <p class="message">
                                <b><a href="{% url 'tradingSystem:view_user_profile' reply.user_id.phone_number %}" class="name">
                                    {{ reply.user_id.user_name }}</a>
                                回复<a href="{% url 'tradingSystem:view_user_profile' reply.comment.user_id.phone_number %}" class="name">
                                    {{ reply.comment.user_id.user_name }}：</a>
                                <small class="text-muted pull-right"><i class="fa fa-clock-o"></i> {{ reply.reply_time | date:'Y年m月d日 H时m分'}} </small></b>

                                {{ reply.content }}
                            </p>
                            </div>
                        {% endfor %}
                    </div>
                    <!-- /.chat -->
                    <div class="box-footer">
                        <form action="{% url 'tradingSystem:add_reply' %}" method="post">
                            {% csrf_token %}
                            <div class="input-group">
                                <input class="form-control" name="content" placeholder="输入您的评论，注意网络文明用语 ...">
                                <input type="text" hidden="hidden" name="phone_number" value="{{ user.phone_number }}">
                                <input type="text" hidden="hidden" name="comment_id" value="{{ comment.id }}">
                                <div class="input-group-btn">
                                    <button type="submit" class="btn btn-success"><i class="fa fa-plus"></i></button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
                <!-- /.box (chat box) -->
            </div>

        </div>
        <div class="row">

        </div>

    </section>


{% endblock %}